package com.wetao.lib_common.greendao.model;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.ToMany;

import java.util.List;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;
import com.wetao.lib_common.greendao.dao.DaoSession;
import com.wetao.lib_common.greendao.dao.WireQuestionDao;
import com.wetao.lib_common.greendao.dao.ExamListenDao;
import com.wetao.lib_common.greendao.dao.WireExamDao;

@Entity
public class WireExam {
    public void setQuestionList(List<WireQuestion> questionList) {
        this.questionList = questionList;
    }

    public List<WireQuestion> getQuestionList2() {
        return this.questionList;
    }

    @Id(autoincrement = true)
    private Long id;
    @NotNull
    private Integer examPublishId;
    @NotNull
    private Integer studentExamId;
    private String examName;
    private Integer examId;
    private Integer state;
    private Integer examType;

    private String beginTime; //自己管理
    private String finishTime; //自己管理
    private Integer totalNum; //总数
    private Integer dealNum; //已作答

    @ToMany(referencedJoinProperty = "assistantExamId")
    List<WireQuestion> questionList;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 2030181358)
    private transient WireExamDao myDao;

    @Generated(hash = 1273730391)
    public WireExam(Long id, @NotNull Integer examPublishId,
            @NotNull Integer studentExamId, String examName, Integer examId,
            Integer state, Integer examType, String beginTime, String finishTime,
            Integer totalNum, Integer dealNum) {
        this.id = id;
        this.examPublishId = examPublishId;
        this.studentExamId = studentExamId;
        this.examName = examName;
        this.examId = examId;
        this.state = state;
        this.examType = examType;
        this.beginTime = beginTime;
        this.finishTime = finishTime;
        this.totalNum = totalNum;
        this.dealNum = dealNum;
    }

    @Generated(hash = 722958230)
    public WireExam() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getExamPublishId() {
        return this.examPublishId;
    }

    public void setExamPublishId(Integer examPublishId) {
        this.examPublishId = examPublishId;
    }

    public Integer getStudentExamId() {
        return this.studentExamId;
    }

    public void setStudentExamId(Integer studentExamId) {
        this.studentExamId = studentExamId;
    }

    public String getExamName() {
        return this.examName;
    }

    public void setExamName(String examName) {
        this.examName = examName;
    }

    public Integer getExamId() {
        return this.examId;
    }

    public void setExamId(Integer examId) {
        this.examId = examId;
    }

    public Integer getState() {
        return this.state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getExamType() {
        return this.examType;
    }

    public void setExamType(Integer examType) {
        this.examType = examType;
    }

    public String getBeginTime() {
        return this.beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getFinishTime() {
        return this.finishTime;
    }

    public void setFinishTime(String finishTime) {
        this.finishTime = finishTime;
    }

    public Integer getTotalNum() {
        return this.totalNum;
    }

    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }

    public Integer getDealNum() {
        return this.dealNum;
    }

    public void setDealNum(Integer dealNum) {
        this.dealNum = dealNum;
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 1516100745)
    public List<WireQuestion> getQuestionList() {
        if (questionList == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            WireQuestionDao targetDao = daoSession.getWireQuestionDao();
            List<WireQuestion> questionListNew = targetDao
                    ._queryWireExam_QuestionList(id);
            synchronized (this) {
                if (questionList == null) {
                    questionList = questionListNew;
                }
            }
        }
        return questionList;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 1378007343)
    public synchronized void resetQuestionList() {
        questionList = null;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 181608445)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getWireExamDao() : null;
    }
   
}
